<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="bean.Donate"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<table cellpadding="0" cellspacing="0" width="640" align="right">
	<tr>
		<td>
			<hr width="630" color="#CC9966" align="right" />
		</td>
	</tr>
	<tr>
		<td style="padding-left: 20">
			<img src="images/jztj.gif" />
		</td>
	</tr>

	<tr>
		<td>
			<hr width="630" color="#CC9966" align="right" />
		</td>
	</tr>

	<tr>
		<td>
			<table cellpadding="3" cellspacing="0" width="600" align="center">
				<c:forEach items="${separate_donate_list}" var="donate">
					<tr>
						<td>
							${donate.donate_name}
						</td>
						<td>
							${donate.donate_price}
						</td>
						<td>
							${donate.donate_need}
						</td>
						<td>
							${donate.donate_date}
						</td>
					</tr>
				</c:forEach>

			</table>
		</td>
	</tr>
	<tr>
		<td class='' style="padding-top: 30; padding-left: 250">
			<div style="font-size: 12">
				共有<b>${donate_total_items}</b>条记录 当前第<b>${donate_current_page}</b>/<b>${donate_total_pages}</b>页
				<input type="text" name="inputIndex" id="inputIndex" size="2" />
				<a href="javascript:;" class="style1" id="forward1" onclick="check('${donate_total_pages}')"
				>跳转</a>
				<c:if test="${donate_current_page!=1}">
					<a href="separateDonate?page=thanks.jsp&index=1" class="style1">上一页</a>
				</c:if>
				<c:if test="${donate_current_page!=donate_total_pages}">
					<a href="separateDonate?page=thanks.jsp&index=2" class="style1">下一页</a>
				</c:if>

			</div>
		</td>
	</tr>
</table>

<script type="text/javascript">
	function check(donate_total_pages) {
		var input = document.getElementById("inputIndex").value;
		var regex = /^[1-9][0-9]*$/;
		if (input == "" ) {
			alert("输入的数字不能为空!");
		} else if (!regex.test(input)) {
			alert("输入的数字不符合要求!");
		}else if (input > donate_total_pages) {
			alert("输入的数字超过最大页数!");
		}else {
			document.getElementById("forward1").href = "separateDonate?page=thanks.jsp&index=3&indexpagedonate="
					+ input;
		}
	}
</script>